﻿
@{
    ViewData["Title"] = "UserEdit";
}

<!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
       帐号管理
        <small>Preview</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li><a href="#">Forms</a></li>
        <li class="active">Advanced Elements</li>
    </ol>
</section>
<!-- Main content -->
<section class="content">
    <!-- SELECT2 EXAMPLE -->
    <div class="box box-default">
        <div class="box-header with-border">
            <h3 class="box-title">新增</h3>
            <div class="box-tools pull-right">
                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button>
            </div>
        </div><!-- /.box-header -->
        <div class="box-body">


       

            <form class="form-horizontal" method="post" asp-controller="Admin" asp-action="UserAdd" enctype="multipart/form-data">
                @Html.AntiForgeryToken()
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>类型</label>
                            <select class="form-control select2" name="userType" id="userType" style="width: 100%;">
                                <option selected="selected" value="0">用户</option>
                                <option value="1">公司</option>
                                <option value="99">管理员</option>

                            </select>
                        </div><!-- /.form-group -->
                        <div class="form-group">
                            <label for="exampleInputEmail1">用户名</label>
                            <input type="text" class="form-control" id="userName" name="userName" placeholder="用户名" style="width: 100%;">
                        </div>
                        <div class="form-group">
                            <label for="exampleInputPassword1">密码</label>
                            <input type="password" class="form-control" id="userPass" name="userPass" placeholder="密码" style="width: 100%;">
                        </div>
                        <!-- /.form-group -->
                    </div><!-- /.col -->
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>上级公司</label>
                            <select class="form-control select2" id="pid" name="pid" style="width: 100%;">
                                <option selected="selected" value="0">顶级</option>



                            </select>
                        </div><!-- /.form-group -->
                        <div class="form-group">
                            <label for="exampleInputEmail1">联系方式</label>
                            <input type="text" class="form-control" id="contactInfo" name="contactInfo" placeholder="联系人" style="width: 100%;">
                        </div>
                        <div class="form-group">
                            <label for="exampleInputPassword1">联系人</label>
                            <input type="text" class="form-control" id="linkMan" name="linkMan" placeholder="联系方式" style="width: 100%;">
                        </div>
                    </div><!-- /.col -->


                    <div class="col-md-12">

                        <div class="form-group">
                            <label for="exampleInputEmail1">支付宝推广地址</label>
                            <input type="text" class="form-control" id="alipayUrl" name="alipayUrl" placeholder="支付宝推广地址" style="width: 100%;">
                        </div>
                        <div class="form-group">
                            <label for="exampleInputPassword1">淘宝推广地址</label>
                            <input type="text" class="form-control" id="taobaoUrl" name="taobaoUrl" placeholder="淘宝推广地址" style="width: 100%;">
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" id="btnok" class="btn  btn-danger">提交</button>

                            </div>
                        </div>
                    </div>

                </div><!-- /.row -->
            </form>
        </div><!-- /.box-body -->
        <div class="box-footer">
           
        </div>
    </div><!-- /.box -->
    <!-- /.row -->
</section><!-- /.content -->
<script type="text/javascript">
    /*
    $("#btnok").click(function () {


       // console.log(GetJsonData());
      //  return;
        var data = $("#tf").serializeArray(); //自动将form表单封装成json
        console.log(data);
        return;
   
    $.ajax({
        type: "POST",
        url: "UserAdd",
        contentType: "application/json; charset=utf-8",
        data: JSON.stringify(GetJsonData()),
        dataType: "json",
        success: function (message) {
            if (message > 0) {
                alert("请求已提交！我们会尽快与您取得联系");
            }
        },
        error: function (message) {
            $("#request-process-patent").html("提交数据失败！");
        }
    });
});

    function GetJsonData() {

    var json = {
        "id": 0,
        "userType": $("#userType").val(),
        "userName": $("#userName").val(),
        "userPass": $("#userPass").val(),
        "pid": $("#pid").val(),
        "contactInfo": $("#contactInfo").val(),
        "linkMan": $("#linkMan").val(),
        "alipayUrl": $("#alipayUrl").val(),
        "taobaoUrl": $("#taobaoUrl").val()
    };
    return json;
}
*/
</script>
